/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012-2013 Oliver Katz */

#ifndef __COMMON_PLUGIN_API_H
#define __COMMON_PLUGIN_API_H

#include <stdio.h>
#include "data.h"
#include "fio.h"
#include "list.h"
#include "msg.h"

#define Z_PLUGIN_NAME(name) char *_z_pluginapi_namer(){return name;}
#define Z_PLUGIN_BEGIN_SIGS() int _z_pluginapi_sic(char *s, int *l) {*l = 0;
#define Z_PLUGIN_SIG(name) *l = *l+1; if (s != NULL && strcmp(s, name) == 0) {return *l-1;}
#define Z_PLUGIN_END_SIGS() return -1;}
#define Z_PLUGIN_HANDLER(handler) z_data _z_pluginapi_handler(int s, z_data d){return handler(s, d);}

/// This is the plugin API. For an example of how to write a plugin look at common/test_plugin.c or the tutorial.

#endif